﻿<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<c:set var="ctx" value="${pageContext.request.contextPath}"/>
<html>
<head><link rel="stylesheet" href="${ctx}/common/common.css">
    <title>Title</title>
    <link rel="stylesheet" href="${ctx}/common/plugins/layuiadmin/layui/css/layui.css" media="all">
    <link rel="stylesheet" href="${ctx}/common/plugins/layuiadmin/style/admin.css" media="all">
    <script src="${ctx}/common/plugins/layuiadmin/layui/layui.js"></script>
    
    <script src="${ctx}/common/plugins/jquery-1.10.2.min.js"></script>
</head>
<body>
<form class="layui-form" action="${ctx}/ddDetail/ddDetailSave">
    <input type="hidden" name="id" value="${ddDetail.id}"/>
    <div class="layui-form-item layui-col-md5" style="margin-top: 50px;" >
        <label class="layui-form-label">上级类别<span style="color: red">*</span></label>
        <div class="layui-input-block">
            <input type="text" name="name" value="${ddDetail.name}" id="materialsBtn"  readonly   lay-verify="required"  placeholder="请选择原料类别" autocomplete="on"   class="layui-input">
            <input type="hidden" name="tDId" id="t_d_id" value="${ddDetail.tDId}"  readonly lay-verify="required"  autocomplete="on"   class="layui-input">
        </div>
    </div>
    <div class="layui-form-item layui-col-md5"  style="display:none;">
        <label class="layui-form-label">编码</label>
        <div class="layui-input-block">
            <input type="text" name="classify" value="${ddDetail.classify}" id="classify" readonly lay-verify="required"   placeholder="选择类别自动填写" autocomplete="off" class="layui-input">
        </div>
    </div>

    <div class="layui-form-item layui-col-md5">
        <label class="layui-form-label">字典描述<span style="color: red">*</span></label>
        <div class="layui-input-block">
            <input type="text" name="described" value="${ddDetail.described}" lay-verify="required"   placeholder="请输入字典描述" autocomplete="off" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <div class="layui-input-block">
            <button class="layui-btn" id="formBtn" lay-submit lay-filter="formDemo">立即提交</button>
            <button type="reset" class="layui-btn layui-btn-primary">重置</button>
            <button type="button" id="rollback" class="layui-btn layui-btn-primary">返回</button>
        </div>
    </div>
</form>
<script>
    var form = null;
    layui.use('form', function () {
        form = layui.form;
        var $ = layui.$;
        //监听提交
        form.on('submit(formDemo)', function (data) {
            layer.load(1, {
                shade: [0.1, '#fff'] //0.1透明度的白色背景
            });
        });
        $("#materialsBtn").on("click",function(){
            layer.open({
                type: 2,
                title: '物料信息',
                shadeClose: true,
                offset: '10px',
                shade: 0.8,
                area: ['40%', '80%'],
                content: '${ctx}/ddDetail/queryMaterialsTree' //iframe的url
            });
        })
    });
    document.getElementById("rollback").addEventListener("click",function(){
        window.history.back();
    })
</script>
</body>
</html>



